import React, { lazy } from "react";

const Home = lazy(() => import("../views/home"));
const List = lazy(() => import("../views/list"));
const Login = lazy(() => import("../views/login"));
const Set = lazy(() => import("../views/set"));
const Upload = lazy(() => import("../views/upload"));
const MainLayout = lazy(() => import("../views/mainLayout"));
const UploadOss = lazy(() => import('../views/uploadOss'))

// 二级路由
export const mainLayoutChildren = [
  {
    path: "/",
    element: <Home></Home>,
    title: '首页'
  },
  {
    path: "/upload",
    element: <Upload></Upload>,
    title: '上传'
  },
  {
    path: "/upload/oss",
    element: <UploadOss></UploadOss>,
    title: '上传云服务'
  },
  {
    path: "/list",
    element: <List></List>,
    title: '列表'
  },
  {
    path: "/set",
    element: <Set></Set>,
    title: '设置'
  },
];


// 一级路由
export const routers_list = [
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    children: mainLayoutChildren,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
];
